![]() |
PATH![]() |
![]() ![]() |
Obtains the amount of data available for retrieval in a download operation.
OSStatus URLGetDataAvailable (
URLReference urlRef,
Size *dataSize);
The URLGetDataAvailable function obtains the amount of data in bytes that is available for your application to retrieve. This function returns meaningful data only if you have initiated a download process.
IMPORTANT
The URLGetDataAvailable function returns only the number of bytes in buffers that remain after you have already copied data from buffers by calling URLGetBuffer . The number returned does not include the number of bytes in transit to a buffer, nor does it include the amount of data not yet transferred from the URL.
This function returns the amount of data remaining in buffers, so do not use it to calculate the amount of remaining data to be downloaded. To determine the amount of data remaining to be downloaded, call URLGetProperty and specify the kURLResourceSize property in URLCallbackInfo . You can then subtract the amount of data copied by URLGetBuffer to determine the amount of data remaining to be transferred to your application.